package org.dromara.business.service;

import com.baomidou.mybatisplus.extension.service.IService;
import org.dromara.business.domain.Goods;
import org.dromara.business.domain.vo.GoodsVo;
import org.dromara.business.domain.vo.SellerGoodsVo;
import org.dromara.common.mybatis.core.page.PageQuery;
import org.dromara.common.mybatis.core.page.TableDataInfo;
import org.springframework.data.repository.query.Param;

import java.util.Collection;
import java.util.List;

/**
 * 任务Service接口
 *
 * @author zlj
 * @date 2024-08-01
 */
public interface GoodsService extends IService<Goods> {

    /**
     * 查询任务
     */
    GoodsVo queryById(Long goodsId);

    /**
     * 查询任务列表
     */
    TableDataInfo<GoodsVo> queryPageList(Goods bo, PageQuery pageQuery);

    /**
     * 查询任务列表
     */
    List<GoodsVo> queryList(Goods bo);

    /**
     * 新增任务
     */
    Long insertByBo(Goods bo);

    /**
     * 修改任务
     */
    Boolean updateByBo(Goods bo);

    /**
     * 校验并批量删除任务信息
     */
    Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);

    boolean updateGoodsStatus(Long goodsId, Integer status, String infoDesc);

    /**
     * 卖家查看任务在售情况
     * @param userId 卖家id
     * @param type 1.进行中 2.已完成
     */
    List<SellerGoodsVo> sellerListGoods(@Param("userId") String userId, @Param("type") int type);

    boolean goodsUp(Long goodsId);

    Boolean takeOrders(Long goodsId);

    Boolean served(Long goodsId);

    Boolean receiving(Long goodsId);

    Boolean up(Long goodsId);

    Boolean removeGoods(Long goodsId);

    Boolean removeByUser(Long goodsId);
}
